package com.webapp.spring;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class SpringHelper {
	public static ApplicationContext ac;
	private static String contextPath="classpath:/spring/spring-applicationContext.xml";
	private static void init(){
		ac=new FileSystemXmlApplicationContext(contextPath);
	}
	public static Object getBean(String beanName){
		if(ac==null)init();
		return ac.getBean(beanName);
	}
}
